package com.rany.day07.demo01;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Objects;

public class TestCollection {
    public static void main(String[] args) {
        Collection<String> collection = new ArrayList<>();
        //add
        collection.add("linw");
        collection.add("luyu");
        collection.add("gugu");
        System.out.println(collection);
        //size
        int size = collection.size();
        System.out.println(size);
        //kong
        boolean empty = collection.isEmpty();
        System.out.println(empty);
        //oanduan
        System.out.println(collection.contains("gugu"));
        //yichu
        collection.remove("gugu");
        //zhuanweishuzu
        Object[] objects1 = collection.toArray();
        System.out.println(objects1);
        collection.clear();
        System.out.println(collection);
    }
}
